<?php
/**
 * Description of Emms_Report_ActivePayments
 *
 * @author andres
 */
class Emms_Report_ActivePayments extends HTech_Report
{
    protected function _setName() 
    {
        $this->_name = $this->translate('Payments');
    }

    protected function _setForm() 
    {
        $this->_form = new HTech_Report_Form_DateRange();
    }
    
    protected function _setIndex() {}

    protected function _setSql() 
    {
        $this->_sql = '
            select 
                * 
            from 
                view_payments 
            where 
                Date >= :dateFrom and 
                Date <= :dateTo';
    }
    
    protected function _setHeaders()
    {
        $this->_headers = new stdClass();
        $this->_headers->PaymentId = $this->translate('Payment Id');
        $this->_headers->LoanId = $this->translate('Loan Id');
        $this->_headers->ReceiptId = $this->translate('Receipt Id');
        $this->_headers->Date = $this->translate('Date');
        $this->_headers->Pmt = $this->translate('Payment');
        $this->_headers->Penalties = $this->translate('Penalties');
        $this->_headers->Delay = $this->translate('Delay');
        $this->_headers->Interest = $this->translate('Interest');
        $this->_headers->LoanInsurance = $this->translate('Loan insurance');
        $this->_headers->HealthInsurance = $this->translate('Health insurance');
        $this->_headers->AdministrativeFee = $this->translate('Admin. fee');
        $this->_headers->Principal = $this->translate('Principal');
        $this->_headers->BalancePrincipal = $this->translate('Principal balance');
        $this->_headers->BalanceLoanInsurance = $this->translate('Loan insurance balance');
        $this->_headers->BalanceHealthInsurance = $this->translate('Health insurance balance');
        $this->_headers->BalanceAdministrativeFee = $this->translate('Admin. fee balance');
        $this->_headers->Special = $this->translate('Special payment');
        $this->_headers->TransactionId = $this->translate('Transaction Id');
        $this->_headers->ClientId = $this->translate('Client Id');
        $this->_headers->ClientCode = $this->translate('Client code');
        $this->_headers->ClientGender = $this->translate('Gender');
        $this->_headers->ClientMobilePhone = $this->translate('Mobile phone');
        $this->_headers->ClientHomePhone = $this->translate('Home phone');
        $this->_headers->ClientFullName = $this->translate('Client name');
        $this->_headers->LocationShortName = $this->translate('Branch');
        $this->_headers->OfficerUsername = $this->translate('Officer');
        $this->_headers->BusinessType = $this->translate('Business');
        $this->_headers->BusinessActivity = $this->translate('Activity');
        $this->_headers->Fund = $this->translate('Fund');
        $this->_headers->ProductLine = $this->translate('Line');
        $this->_headers->Program = $this->translate('Program');
        $this->_headers->LoanProductName = $this->translate('Loan product');
        $this->_headers->Username = $this->translate('Registered by');
        
    }
    
    public function setParams($params) 
    {
        $this->_params = array(
            ':dateFrom' => $params['DateFrom'],
            ':dateTo' => $params['DateTo']);
    }

}
